package com.lanou.service.impl;

import com.lanou.bean.Account;
import com.lanou.mapper.AccountMapper;
import com.lanou.service.AccountService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo on 18/3/16.
 */
@Service
public class AccountServiceImpl implements AccountService {
    @Resource
    AccountMapper mapper;

    @Override
    public List<Account> getAllAccountInfo() {
        return mapper.getAllAccountInfo();
    }

    @Override
    public void deleteAccount(@Param("id") int id) {
        mapper.deleteAccount(id);
    }

    @Override
    public void updateAccount(int id, String status) {
        mapper.updateAccount(id, status);
    }

    @Override
    public Account selectAccountById(@Param("id") int id) {
        return mapper.selectAccountById(id);
    }

    @Override
    public void updateAccountByid(int id, String name, String tele, String cardno,
                                  String email, String addr, String zipcode,
                                  String qq, String gender, String occupation) {
        mapper.updateAccountByid(id, name, tele, cardno, email, addr, zipcode, qq, gender, occupation);
    }

    @Override
    public Account selectByCardId(@Param("cardno") String cardno) {
        return mapper.selectByCardId(cardno);
    }

    @Override
    public void updatePauseDate(String pause, int id) {
        mapper.updatePauseDate(pause, id);
    }

    @Override
    public void updateDelPauseDate(String pause, int id) {
        mapper.updateDelPauseDate(pause, id);
    }

    @Override
    public void updateCloseDate(String close, int id) {
        mapper.updateCloseDate(close, id);
    }

    @Override
    public void addAccount(Account account) {
        mapper.addAccount(account);
    }
}
